As laptop computers and other portable data processing systems have entered the consumer marketplace, the need for low power data processors has increased dramatically. Low power data processors enable laptop computers and other portable systems to use a battery as a power supply for a longer period of time before replacement or recharging. Generally, circuitry within low power data processors is designed such that overall power consumption is reduced. While the circuit design of a low power data processor reduces power consumption, the software developed by a user must also be optimized to obtain maximum power efficiency. Use of different instructions and even different data in a software program results in widely varying power requirements in any data processor.
Optimizing the power consumption of software in a data processor is presently a difficult problem for most users. A particularly difficult problem is accurately measuring a current drawn by a data processor during execution of a software program. In one method for measuring power consumption of software, the software code is written and programmed into a read-only memory on the data processor integrated circuit before the actual power consumption is known. The power consumed by the processor is then determined by measuring the current after the integrated circuit is manufactured. This method is both slow and expensive. A user must wait until after a part is manufactured to determine if his or her code is optimized for maximum power efficiency. Then, if the code is not optimal and needs to be modified, the user must make corrections and re-program the memory of the data processor. Subsequently, the user must wait while the new version of the data processor is again manufactured to determine if the new code is optimal.
Additionally, a characterization program must typically be developed to measure the operating current and, therefore, the power consumption of the data processor. The characterization program generally measures the total operating current of the data processor and is not able to measure the current of each of the components of the data processor separately. For example, a data processor may include a central processing unit and several peripheral devices such as a timer and input/output circuits. In characterization programs, all of the components are evaluated jointly to determine power consumption and may not be evaluated separately. This prevents the user from adequately considering trade-offs involved in the choice of particular peripherals to perform a desired function.
In a second method for determining power consumption of a data processor, operation of the data processor is simulated using a software program. Theoretically, simulation allows a user to predict power consumption of a data processor before the data processor is actually manufactured. However, such power consumption estimates are typically inaccurate. Parasitic capacitance and other factors which are normal by-products of implementing a data processor as an integrated circuit are rarely approximated with a high degree of accuracy. Additionally, because of the complexity of a data processor, most simulation methods are able to evaluate only a small portion of the circuitry included in a data processor. As well, ranges of operation temperatures and voltages may not be simulated without consuming a large amount of time. Therefore, while the simulation method may be slightly less expensive than the method previously described, it is still expensive and requires an excessive amount of time.
Sometimes a manufacturer implements a third method of measuring power consumption in a data processor. In the third method, an ultra-violet erasable programmable memory (EPROM) is implemented to allow a user to program and re-program a data processor until power consumption is optimized. Although this method allows the user to optimize a software routine in a data processor, implementation costs are often prohibitive to the manufacturer. Effectively, when using the third method, two data processors must be designed. A first design, as described herein, has an ultra-violet erasable programmable memory and a second design has a mask programmable memory which is loaded with the optimized software program for production purposes. In addition to doubling the design effort, the third method is not completely accurate. The ultra-violet erasable programmable memory typically uses more power than the mask programmable memory. Therefore, the third method is both inaccurate and prohibitively expensive for most applications. Additionally, power consumption of all of the separate components may not be measured individually, but jointly.
In a fourth method for determining power consumption of a software program, operation of a target data processor is evaluated using an emulation system. The emulation system uses the target data processor and a plurality of peripheral circuits to emulate operation of the data processor and to provide for connections to portions of the system normally inaccessible to the user due to the integrated circuit implementation of the target data processor. Each of the plurality of peripheral circuits emulate operation of a particular circuit in the data processor. However, in an emulation system, the current drawn by the target data processor and each of the plurality of peripheral circuits is overshadowed by the current drawn by the bus drivers required by the data processor and the plurality of peripheral circuits. While an emulation system allows the current of each of the internal circuits of a data processor to be approximated, the current measurement does not accurately reflect the current drawn only by the internal circuit. Therefore, emulation systems are rarely used to evaluate the current drawn by the target data processor during execution of a software program.
Therefore, a need exists for a system or method for measuring power consumption of each of the components of a data processor separately. The system or method should also be executed quickly and inexpensively.